package com.c.ctgproject.enum

enum class DictionaryMenuEnum(val menuName: String, val menuCode: String) {
    PARTS("零件", "PARTS"),
    CUSTOMER("客户", "CUSTOMER"),
    UNIT("计量单位", "UNIT"),
    BATTERY("电池", "BATTERY"),
    PART_NAME("物品名称", "GOODS_NAME"),//放行
    PART_TYPE("物品类型", "GOODS_TYPE"),//放行
    CHECK_USER("审批人", "CHECK_USER"),//放行 自定义
    SUPPLIER("供应商", "SUPPLIER");


    companion object {
        fun getPartId(name: String): String {
            values().forEach {
                if (it.name == name) {
                    return it.menuCode
                }
            }
            return ""
        }


        fun getPartName(menuCode: String): String {
            values().forEach {
                if (it.menuCode == menuCode) {
                    return it.menuName
                }
            }
            return ""
        }
    }

}